<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>欢迎来到聊天室</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script type="application/javascript" src="/js/jquery-3.5.1.min.js"></script>
    <script type="application/javascript" src="/js/jquery.cookie.js"></script>
    <script type="application/javascript" src="/layui/layui.js"></script>
    <script type="application/javascript" src="/js/plugin.js"></script>
</head>

<body class="layui-layout-body">

<div class="layui-body" style="left: 0px">
    <!-- 内容主体区域 -->
    <div class="layui-row layui-col-space15">
        <form class="layui-form">
        <table  id="user" class="layui-table" lay-even="" lay-skin="nob">
            <colgroup>
                <col>
                <col>
                <col>
                <col>
                <col>
                <col>
                <col>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th colspan="2">用户信息</th>
            </tr>
            </thead>
            <tbody th:fragment="user">
            <tr>
                <td>账号</td>
                <td th:text="${user.user_account}"></td>
            </tr>
            <tr>
                <td>密码</td>
                <td>******</td>
            </tr>
            <tr>
                <td>用户名</td>
                <td th:text="${user.user_name}"></td>
            </tr>
            <tr>
                <td>性别</td>
                <td th:text="${user.user_sex}"></td>
            </tr>
            <tr>
                <td>年龄</td>
                <td th:text="${user.user_age}"></td>
            </tr>
            <tr>
                <td>手机号</td>
                <td th:text="${user.user_phone}"></td>
            </tr>
            <tr>
                <td>地址</td>
                <td th:text="${user.user_address}"></td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td th:text="${user.user_mail}"></td>
            </tr>
            </tbody>
        </table>
            <input id="change" class="layui-btn" type="button" value="修改信息"/>
            <button id="loginOut" class="layui-btn" lay-submit lay-filter="loginOut">退出登录</button>
        </form>
    </div>
</div>

<!-- <div class="layui-footer">
  </div> -->
<script th:inline="javascript">

    $("#change").click(function (){
        iframe("#mainContext","user/change.html");
    })
    $("#loginOut").click(function () {
        $.removeCookie("uuid",{path:"/"});
    });

    ready("#user","/user/manage");

    layui.use('form', function () {
        var form = layui.form;
        //监听提交
        form.on('submit(loginOut)', function (data) {
            $.ajax({
                type: "post",
                url: "/user/loginOut",
                dataType: "json",
                data: data.field
            })
            iframe("#mainContext","hello.html");
            reload();
            return false;
        });
    });
</script>
</body>

</html>